import {baseApiF} from './api'
let baseApi = baseApiF()
// 五险参保人员情况查询
export function queryFiveInsuredsPersonSitu(insuredType, year, month) {
  const data = Object.assign({}, {
    insuredType,
    year,
    month
  })
  return window.axios.post(baseApi + 'society/queryFiveInsuredsPersonSitu', data)
    .then((res) => {
      console.log(res.data)
      return Promise.resolve(res.data)
    })
    .catch((error) => {
      console.log(JSON.stringify(error))
      return Promise.reject(error)
    })
}

// 获取养老本金利息表
export function geOldPensionReport(selectDate) {
  const data = Object.assign({}, {
    selectDate
  })
  return window.axios.post(baseApi + 'geRen/geRenYaoLao', data)
    .then((res) => {
      console.log(res.data)
      return Promise.resolve(res.data)
    })
    .catch((error) => {
      console.log(JSON.stringify(error))
      return Promise.reject(error)
    })
}

// 获取菜单管理左侧数据
export function getMenuManagerList(selectDate) {
  const data = Object.assign({}, {
    selectDate
  })
  return window.axios.post(baseApi + 'menu/initMenu', data)
    .then((res) => {
      console.log(res.data)
      return Promise.resolve(res.data)
    })
    .catch((error) => {
      console.log(JSON.stringify(error))
      return Promise.reject(error)
    })
}

// 编辑菜单列表的数据
export function editMenuListInfo(menuId, menuName, menuOrder, showFlag) {
  const data = Object.assign({}, {
    menuId,
    menuName,
    menuOrder,
    showFlag
  })
  return window.axios.post(baseApi + 'menu/updateMenu', data)
    .then((res) => {
      console.log(res.data)
      return Promise.resolve(res.data)
    })
    .catch((error) => {
      console.log(JSON.stringify(error))
      return Promise.reject(error)
    })
}
